home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16670 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: theory.lcs.mit.edu!wald
  2. From: wald@theory.lcs.mit.edu (David Wald)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: SGI's C++ compiler and the boolean type
  5. Date: 11 Apr 1996 18:01:52 GMT
  6. Organization: Theory of Computation, LCS, MIT
  7. Message-ID: <WALD.96Apr11140152@woodpecker.lcs.mit.edu>
  8. References: <4kefm7$oao@ncar.ucar.edu> <4kg6fv$h7k@nic.ftns.no>
  9.     <WALD.96Apr11105913@woodpecker.lcs.mit.edu>
  10.     <4kjafs$h4b@decaxp.HARVARD.EDU>
  11. NNTP-Posting-Host: woodpecker.lcs.mit.edu
  12. In-reply-to: ccshan@scws40.harvard.edu's message of 11 Apr 1996 16:03:08 GMT
  13.  
  14. In article <4kjafs$h4b@decaxp.HARVARD.EDU> ccshan@scws40.harvard.edu
  15. (Chung-chieh Shan) writes:
  16. >> No user-level definition of bool will make distinguish() return 0, as
  17. >> it must in the draft standard.
  18. >
  19. >Hmm, why can't I just define bool as a class?  I realize there are
  20. >problems with some library routines
  21.  
  22. Not just library routines; as I said in [the deleted portion of] my
  23. post, the comparison operators on base types also must return bool in
  24. the standard, and there's no way to redefine those operators in C++ to
  25. return a user-defined class.  A compiler-supplied bool is the only way
  26. to get the (draft) standard overloading behavior.
  27.  
  28. -David
  29. -- 
  30. ============================================================================
  31. David Wald      http://theory.lcs.mit.edu/~wald/     wald@theory.lcs.mit.edu
  32. ============================================================================
  33.